package com.ke.jun.view.widght

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import android.widget.LinearLayout

class TestViews @JvmOverloads constructor(context: Context, attributeSet: AttributeSet?=null, defStyleAttr:Int=0): LinearLayout(context,attributeSet,defStyleAttr) {
    private var paint1=Paint().apply {
        color=Color.RED
        strokeWidth=20f
        isAntiAlias=true
        style= Paint.Style.FILL
    }
    private var paint2=Paint().apply {
        color=Color.BLUE
        strokeWidth=20f
        isAntiAlias=true
        style=Paint.Style.FILL
    }


    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)
        canvas.drawCircle(200f,300f,100f,paint1)
    }


//    override fun dispatchDraw(canvas: Canvas) {
//        super.dispatchDraw(canvas)
//        canvas.drawCircle(400f,500f,100f,paint2)
//
//    }


}